package com.teach;

import java.util.Arrays;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;

public class Demo0102 {

	private static final ThreadLocalRandom r = ThreadLocalRandom.current();// 多线程随机数 ;直译 : 线程本地随机数

	public static void main(String[] args) {
		for (int x = 0; x < 100; x++) {
			int blue = 0;
			int[] red = new int[6];

			blue = r.nextInt(16) + 1;

//			int[] ball = {1,2,3,4,5,6...33};
			int[] ball = new int[33];
			for (int i = 0; i < 33; i++) {
				ball[i] = i + 1;
			}
			for(int i=0;i<red.length;i++) {
				System.out.println(Arrays.toString(ball));
				int index = r.nextInt(33-i);
				red[i]=ball[index];
				System.arraycopy(ball, index+1, ball, index, 32-index);
				
			}

			Arrays.sort(red);
			
			System.out.println("蓝球:" + blue);
			System.out.println("红球:" + Arrays.toString(red));
		}
	}

}
